From 57510668d9d961e6f63ede6111cc7cdcb22b18cd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 19 May 2016 02:41:30 +0300 Subject: [PATCH] more regexp fixes --- tests/test_cargo_bench.rs | 14 ++++++-------- tests/test_cargo_compile_custom_build.rs | 8 ++++---- tests/test_cargo_cross_compile.rs | 18 +++++++++--------- tests/test_cargo_registry.rs | 14 +++++++------- tests/test_cargo_test.rs | 12 ++++++------ 5 files changed, 32 insertions(+), 34 deletions(-) diff --git a/tests/test_cargo_bench.rs b/tests/test_cargo_bench.rs index 967368be8..eb1c90a73 100644 --- a/tests/test_cargo_bench.rs +++ b/tests/test_cargo_bench.rs @@ -174,20 +174,18 @@ test!(cargo_bench_failing_test { execs().with_stdout("hello\n")); assert_that(p.cargo("bench"), - execs().with_stdout_contains(&format!("\ + execs().with_stdout_contains(" +running 1 test +test bench_hello ... ") + .with_stderr_contains(format!("\ [COMPILING] foo v0.5.0 ({}) [RUNNING] target[..]release[..]foo-[..] - -running 1 test -test bench_hello ... ", - p.url())) - .with_stderr_contains("\ thread '
' panicked at 'assertion failed: \ `(left == right)` (left: \ `\"hello\"`, right: `\"nope\"`)', src[..]foo.rs:14 [..] -") - .with_status(101)); +", p.url())) + .with_status(101)); }); test!(bench_with_lib_dep { diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index aa76d2911..c74446f63 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -556,7 +556,7 @@ test!(propagation_of_l_flags { assert_that(p.cargo_process("build").arg("-v").arg("-j1"), execs().with_status(0) - .with_stdout_contains("\ + .with_stderr_contains("\ [RUNNING] `rustc [..] --crate-name a [..]-L bar[..]-L foo[..]` [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name foo [..] -L bar -L foo` @@ -609,7 +609,7 @@ test!(propagation_of_l_flags_new { assert_that(p.cargo_process("build").arg("-v").arg("-j1"), execs().with_status(0) - .with_stdout_contains("\ + .with_stderr_contains("\ [RUNNING] `rustc [..] --crate-name a [..]-L bar[..]-L foo[..]` [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name foo [..] -L bar -L foo` @@ -1815,7 +1815,7 @@ test!(doctest_recieves_build_link_args { assert_that(p.cargo_process("test").arg("-v"), execs().with_status(0) - .with_stdout_contains("\ + .with_stderr_contains("\ [RUNNING] `rustdoc --test [..] --crate-name foo [..]-L native=bar[..]` ")); }); @@ -1855,7 +1855,7 @@ test!(please_respect_the_dag { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0) - .with_stdout_contains("\ + .with_stderr_contains("\ [RUNNING] `rustc [..] -L native=foo -L native=bar[..]` ")); }); diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index 550107c5a..2867619b1 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -663,27 +663,27 @@ test!(build_script_needed_for_host_and_target { assert_that(p.cargo_process("build").arg("--target").arg(&target).arg("-v"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [COMPILING] d1 v0.0.0 ({url}/d1)", url = p.url())) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [RUNNING] `rustc d1[..]build.rs [..] --out-dir {dir}[..]target[..]build[..]d1-[..]`", dir = p.root().display())) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [RUNNING] `{dir}[..]target[..]build[..]d1-[..]build-script-build`", dir = p.root().display())) - .with_stdout_contains("\ + .with_stderr_contains("\ [RUNNING] `rustc d1[..]src[..]lib.rs [..]`") - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [COMPILING] d2 v0.0.0 ({url}/d2)", url = p.url())) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [RUNNING] `rustc d2[..]src[..]lib.rs [..] \ -L /path/to/{host}`", host = host)) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [COMPILING] foo v0.0.0 ({url})", url = p.url())) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [RUNNING] `rustc build.rs [..] --out-dir {dir}[..]target[..]build[..]foo-[..] \ -L /path/to/{host}`", dir = p.root().display(), host = host)) - .with_stdout_contains(&format!("\ + .with_stderr_contains(&format!("\ [RUNNING] `rustc src[..]main.rs [..] --target {target} [..] \ -L /path/to/{target}`", target = target))); }); diff --git a/tests/test_cargo_registry.rs b/tests/test_cargo_registry.rs index f1ddce8b8..8c35f7137 100644 --- a/tests/test_cargo_registry.rs +++ b/tests/test_cargo_registry.rs @@ -860,19 +860,19 @@ test!(update_multiple_packages { assert_that(p.cargo("build"), execs().with_status(0) - .with_stdout_contains("\ + .with_stderr_contains("\ [DOWNLOADING] a v0.1.1 (registry file://[..])") - .with_stdout_contains("\ + .with_stderr_contains("\ [DOWNLOADING] b v0.1.1 (registry file://[..])") - .with_stdout_contains("\ + .with_stderr_contains("\ [DOWNLOADING] c v0.1.1 (registry file://[..])") - .with_stdout_contains("\ + .with_stderr_contains("\ [COMPILING] a v0.1.1 (registry [..])") - .with_stdout_contains("\ + .with_stderr_contains("\ [COMPILING] b v0.1.1 (registry [..])") - .with_stdout_contains("\ + .with_stderr_contains("\ [COMPILING] c v0.1.1 (registry [..])") - .with_stdout_contains("\ + .with_stderr_contains("\ [COMPILING] foo v0.5.0 ([..])")); }); diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index da631fdb8..d40271580 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -184,10 +184,10 @@ test!(cargo_test_failing_test { execs().with_stdout("hello\n")); assert_that(p.cargo("test"), - execs().with_stdout_contains(format!("\ + execs().with_stderr(format!("\ [COMPILING] foo v0.5.0 ({url}) -[RUNNING] target[..]foo-[..] - +[RUNNING] target[..]foo-[..]", url = p.url())) + .with_stdout_contains(" running 1 test test test_hello ... FAILED @@ -197,14 +197,14 @@ failures: thread 'test_hello' panicked at 'assertion failed: \ `(left == right)` (left: \ `\"hello\"`, right: `\"nope\"`)', src[..]foo.rs:12 -", url = p.url())) - .with_stdout_contains("\ +") + .with_stdout_contains("\ failures: test_hello test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured ") - .with_status(101)); + .with_status(101)); }); test!(test_with_lib_dep { -- 2.30.2